/*
 * Copyright (c) 2020 Fraunhofer FOKUS and others. All rights reserved.
 *
 * See the NOTICE file(s) distributed with this work for additional
 * information regarding copyright ownership.
 *
 * This program and the accompanying materials are made available under the
 * terms of the Eclipse Public License 2.0 which is available at
 * http://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contact: mosaic@fokus.fraunhofer.de
 */
package org.eclipse.mosaic.fed.application.ambassador.simulation.mec;

import org.eclipse.mosaic.lib.geo.GeoSector;
import org.eclipse.mosaic.lib.objects.traffic.MecDetectorInfo;
import org.eclipse.mosaic.lib.objects.vehicle.VehicleData;

import java.util.Map;

/**
 * A MecDetector is used to retrieve the information of
 * a {@link org.eclipse.mosaic.lib.objects.traffic.MecDetectorInfo}
 */
public class MecDetector {

    private final String id;
    private final GeoSector area;
    private MecDetectorInfo mecDetectorInfo;

    public MecDetector(String id, GeoSector area) {
        this.id = id;
        this.area = area;
    }

    public void update(MecDetectorInfo info) {
        this.mecDetectorInfo = info;
    }

    public String getId() {
        return id;
    }

    public GeoSector getArea() {
        return area;
    }

    public Map<Long, VehicleData> getVehiclesInArea() {
        return mecDetectorInfo.getVehicles();
    }

}
